package org.emergency.framework.action.oa;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.emergency.framework.action.BaseAction;
import org.emergency.framework.model.contactDeptTree.EmergencyTree;
import org.emergency.framework.otherDatasourse.ITbSysConfigDAO;
import org.emergency.framework.service.common.ITreeDeptService;
import org.springframework.stereotype.Repository;
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.util.WebUtils;


/**
 * 这个departmentaction不是和department拿数据,而是向
 * 虚拟树拿
 * @author Administrator
 *
 */
@Repository("tbDepartmentAction")
public class TbDepartmentAction extends BaseAction{
	
	protected static Logger log  = Logger.getLogger("xxx");

	private ITreeDeptService treeService;// 虚拟树的服务层

	@Resource(name = "treeDeptServiceImpl")
	public void setTreeService(ITreeDeptService treeService) {
		this.treeService = treeService;
	}

	private EmergencyTree emergencyTree;

	public EmergencyTree getEmergencyTree() {
		
		ITbSysConfigDAO tbSysConfigDAO = (ITbSysConfigDAO) WebApplicationContextUtils
		.getWebApplicationContext(this.getServletContext()).getBean("tbSysConfigDAOImpl");
		
		ITbSysConfigDAO tbSysConfigDAO1 = (ITbSysConfigDAO) WebApplicationContextUtils
		.getWebApplicationContext(this.getServletContext()).getBean("tbSysConfigDAOImpl");
		
		
		log.info(tbSysConfigDAO1);
		log.info(tbSysConfigDAO);
		return treeService.queryEmergencyTree();
	}

	public void setEmergencyTree(EmergencyTree emergencyTree) {
		this.emergencyTree = emergencyTree;
	}

}
